<?php

require_once './include/common.inc.php';
require_once 'left.php';
require_once 'right.php';
include_once './include/cart.class.php';

@header("Content-Type:text/html;charset=iso-8859-1");
$page_title = 'Acuity World WebShop';
$menu_id = 0;
$menu_str = PrintMenu();

$sql = "SELECT * FROM  `cus_members` WHERE  `id` = '" . $_POST['uid'] . "'";
$user_info_ary = $db->get_one($sql);
if (empty($user_info_ary)) {
    header("location:" . $WEB_URL . "member_signup.php");
    exit;
}

$phone = str_replace("||", " " , $user_info_ary['phone']);
$mobile = str_replace("||", " " , $user_info_ary['mobile']);
$fax = str_replace("||", " " , $user_info_ary['fax']);

$faq2_checked = $_POST['faq2'];

$set_country = $_POST['set_country'];

$card_name = $_POST['card_name'];
$card_number = $_POST['card_number'];
$card_type = $_POST['card_type'];
$card_emonth = $_POST['card_emonth'];
$card_eyear = $_POST['card_eyear'];
$card_cvc = $_POST['card_cvc'];

if ($card_type == 'DK') {
    $card_type_show = '<img src="images/card03.gif" width="31" height="21">&nbsp;&nbsp;Dankort or Visa/Dankort';
} elseif ($card_type == 'MC(DK)') {
    $card_type_show = '<img src="images/card02.gif" width="32" height="21">&nbsp;&nbsp;MasterCard';
} else {
    $card_type_show = '<img src="images/card01.gif" width="31" height="21">&nbsp;&nbsp;Visa';
}


$user_street = $_POST['user_street'];
$user_city = $_POST['user_city'];
$user_zip = $_POST['user_zip'];
$user_state = $_POST['user_state'];
$user_country = $_POST['user_country'];

$cart = new cart();

//$cart = unserialize(getMvalue('cart_info'));
$cart = unserialize(getCartInfo($_POST['uid']));

//echo "<pre>";print_r($cart);exit;


$info_ary = $cart->getData();
$total_qty = $cart->getSortCount();
$total_cost = $cart->getTotalCost();
$total_cost2 = $cart->getTotalCost2();

$cart_addvat = $cart->getAddVat();
$cart_addshippingfee = $cart->getAddShippingFee();
$cart_discount = $cart->getDisCount();

$new_total_cost = number_format(round($total_cost - $cart_discount, 2), 2, '.', '');

$promoter_id = $cart->getPromoterId();

$sql = "SELECT `firstname`, `lastname` FROM `promoter_info` WHERE `id` = '$promoter_id' AND `status` = '1' AND `rank` > 0 ";
$promoter_ary = $db->get_one($sql);
$promoter_name = empty($promoter_ary['lastname']) ? $promoter_ary['firstname'] : $promoter_ary['firstname'] . ' ' . $promoter_ary['lastname'];


$paymentBOX['baseURL']			= 'https://betaling.wannafind.dk/';
$paymentBOX['proxyURL']			= $paymentBOX['baseURL'].'proxy/p.php/';

$pay_url = $paymentBOX['proxyURL'] .'http://'. $paymentBOX['mydomain'].$paymentBOX['path'] . "jump_pay2.php";
$inProxy=true;//used in head.htm

require_once PrintEot('header');
require_once PrintEot('left');
require_once PrintEot('payment');
require_once PrintEot('right');
require_once PrintEot('footer');


?>